package com.jumi.microservice;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import springfox.documentation.swagger2.annotations.EnableSwagger2;


/**
 * - - - - - - - - - - - - - - -
 * 商品管理启动类
 * @author liuz
 * @date 2020/7/27 16:56
 * ToDoSomeThing
 * - - - - - - - - - - - - - - -
 */
@EnableDiscoveryClient
@SpringBootApplication
@EnableSwagger2
@MapperScan("com.jumi.microservice.mapper")
@ServletComponentScan
@EnableFeignClients
public class CommodityApplication {

    public static void main(String[] args){
        SpringApplication.run(CommodityApplication.class, args);
    }

    /**
     * 开启mbp的分页
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        return paginationInterceptor;
    }
}
